Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard

Image serialization mode. Applicable only when serializeImages is true.

Link copied to clipboard

Scanners typically can produce better results from a single image if they are allowed to spend a longer time analyzing it. On the other hand, scanners can produce even better results if they can analyze multiple images of the same subject and cross-check and combine the results. The processing mode tells the scanner whether to optimize for single or multiple images of a subject.

Link copied to clipboard
data class ToJsonConfiguration(val serializeImages: Boolean = true, val imageSerializationMode: ImageSerializationMode = ImageSerializationMode.REFERENCE) : Parcelable

Configuration used to serialize an object to json.

Functions

Link copied to clipboard
inline fun <R> catchWithResult(block: ReturnBlockScope.() -> R): Result<R>

Transforms the value of the Result using the given block that returns another Result.

Link copied to clipboard
inline fun <T1, T2, R> combine(p1: <Error class: unknown class><Result<T1>>, p2: <Error class: unknown class><Result<T2>>, crossinline block: suspend ReturnBlockScope.(T1, T2) -> Result<R>): <Error class: unknown class><Result<R>>

Combines two Flows with Result instances. If both are Success, applies the provided block to their data. If any is an error, returns that error further.

Link copied to clipboard
inline fun <T1, T2, T3, R> combineResults(p1: <Error class: unknown class><Result<T1>>, p2: <Error class: unknown class><Result<T2>>, p3: <Error class: unknown class><Result<T3>>, crossinline block: suspend ReturnBlockScope.(T1, T2, T3) -> Result<R>): <Error class: unknown class><Result<R>>

Combines three Result instances. If all are Success, applies the provided block to their data. If any is an error, returns that error further.

Link copied to clipboard
inline fun <T, R : Result.Failure> Result<T>.onFailure(clazz: Class<R>, block: ReturnBlockScope.(R) -> Unit): Result<T>
Link copied to clipboard
Link copied to clipboard

Merges a collection of Failure failures into a single Failure failure.

Link copied to clipboard
inline fun <T, R : AutoCloseable> Collection<R>.useAll(block: (List<R>) -> T): T

Executes the given block with all elements of this Collection of AutoCloseable resources, ensuring that all resources are closed after the block completes, even if an exception is thrown.